﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPageContent.master" AutoEventWireup="false"
    CodeFile="PaymentVoucherDtl.aspx.vb" Inherits="PaymentVoucherDtl" %>

<%@ Register Src="~/UserControls/DDL.ascx" TagName="DoubleFilteredDropDownList" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/OneFilteredDropDownList.ascx" TagName="OneFilteredDropDownList"
    TagPrefix="uc2" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeaderPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgPaymentVoucherDtl">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgPaymentVoucherDtl" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgDeduction">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgDeduction" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rbtnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2010Blue"
        Transparency="20">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <br />
    <br />
    <table style="table-layout: fixed;">
        <tr>
            <td>
                <asp:Label ID="lblYear" runat="server" meta:ResourceKey="lblYear"></asp:Label>
            </td>
            <td>
                <telerik:RadNumericTextBox ID="rtbYear" runat="server" MaxLength="4" MaxValue="2020"
                    ValidationGroup="valPaymentVoucherHdr" IncrementSettings-InterceptArrowKeys="true"
                    IncrementSettings-InterceptMouseWheel="true">
                    <NumberFormat DecimalDigits="0" GroupSizes="4" />
                </telerik:RadNumericTextBox>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblManrtbPaymentVoucherNo" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                <asp:Label ID="lblPaymentVoucherNo" runat="server" meta:ResourceKey="lblPaymentVoucherNo"></asp:Label>
            </td>
            <td>
                <telerik:RadTextBox ID="rtbPaymentVoucherNo" runat="server" Skin="MetroTouch" ValidationGroup="valPaymentVoucherHdr">
                </telerik:RadTextBox>
                <asp:RequiredFieldValidator ID="rfvrtbPaymentVoucherNo" runat="server" ControlToValidate="rtbPaymentVoucherNo"
                    ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valPaymentVoucherHdr"></asp:RequiredFieldValidator>
            </td>
            <td>
                <asp:Label ID="lblManrdpPaymentVoucherDate" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                <asp:Label ID="lblPaymentVoucherDate" runat="server" meta:ResourceKey="lblPaymentVoucherDate"></asp:Label>
            </td>
            <td>
                <telerik:RadDatePicker runat="server" ID="rdpPaymentVoucherDate" Culture="English (United States)"
                    ShowPopupOnFocus="true" ValidationGroup="valPaymentVoucherHdr">
                    <DateInput ID="DateInput1" DateFormat="dd/MM/yyyy" runat="server">
                    </DateInput></telerik:RadDatePicker>
                <asp:RequiredFieldValidator ID="rfvrdpPaymentVoucherDate" runat="server" ControlToValidate="rdpPaymentVoucherDate"
                    ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valPaymentVoucherHdr"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblCostCenter" runat="server" Text="<%$ Resources:SystemResource, CostCenter %>"></asp:Label>
            </td>
            <td>
                <uc2:OneFilteredDropDownList ID="rcbCostCenter" runat="server" DataSourceId="odsCostCenter"
                    DataValueField="MINOR" IsRequired="false" DataTextField="<%$ Resources:SystemResource, Lookup %>"
                    DefaultChoosedItem="ChooseOne" />
            </td>
            <td>
                <asp:Label ID="lblMainCostCenter" runat="server" Text="<%$ Resources:SystemResource, MainCostCenter %>"></asp:Label>
            </td>
            <td>
                <uc2:OneFilteredDropDownList ID="rcbMainCostCenter" runat="server" DataSourceId="odsMainCostCenter"
                    DataValueField="MINOR" IsRequired="false" DataTextField="<%$ Resources:SystemResource, Lookup %>"
                    DefaultChoosedItem="ChooseOne" />
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
            </td>
            <td>
                <asp:Label ID="lblPaidforAccountNo" runat="server" meta:ResourceKey="lblPaidforAccountNo"></asp:Label>
            </td>
            <td>
                <uc2:OneFilteredDropDownList ID="rcbPaidforAccountNo" runat="server" DataSourceId="odsSupplier"
                    DataValueField="SupplierID" IsRequired="false" DataTextField="SupplierName" DefaultChoosedItem="ChooseOne"
                    ValidationGroup="valPaymentVoucherHdr" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblRemarks" runat="server" Text="<%$ Resources:SystemResource, Remarks %>"></asp:Label>
            </td>
            <td>
                <telerik:RadTextBox ID="rtbRemarks" runat="server" SkinID="Remarks">
                </telerik:RadTextBox>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <!------------------------------------------------ Details ---------------------------------------------------->
                <telerik:RadGrid ID="rgPaymentVoucherDtl" runat="server" GridLines="None" DataSourceID="sdsPaymentVoucherDtl"
                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" ShowFooter="True" AllowAutomaticUpdates="True"
                    Skin="MetroTouch" AllowPaging="True" AutoGenerateColumns="False" GroupPanel-Text="<%$ Resources:MainGrid ,GroupPanelText %>"
                    CellSpacing="0">
                    <MasterTableView Width="100%" Caption="<%$ Resources:MainGrid , LinesCaption %>"
                        CommandItemDisplay="TopAndBottom" DataKeyNames="PaymentVoucherDtlID" TableLayout="Fixed"
                        HorizontalAlign="NotSet" DataSourceID="sdsPaymentVoucherDtl" NoMasterRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>">
                        <CommandItemTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:ImageButton ID="ibtnInitInsert" CommandName="InitInsert" runat="server" ImageUrl="~/Design/images/Grid/AddRecord.gif"
                                            CausesValidation="false" />
                                        <asp:LinkButton ID="lbtnInitInsert" runat="server" Font-Size="14px" Text="<%$ Resources:MainGrid , AddNew %>"
                                            CommandName="InitInsert" Visible="true" CausesValidation="false" />&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton ID="ibtnEditSelected" CommandName="EditSelected" runat="server"
                                            ImageUrl="~/Design/images/Grid/Edit.gif" />
                                        <asp:LinkButton ID="lbtnEditSelected" runat="server" Font-Size="14px" Text="<%$ Resources:MainGrid , EditSelected %>"
                                            CommandName="EditSelected" Visible="true" />&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton ID="ibtnDeleteSelected" CommandName="DeleteSelected" runat="server"
                                            ImageUrl="~/Design/images/Grid/Delete.gif" />
                                        <asp:LinkButton ID="lbtnDeleteSelected" Font-Size="14px" OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>"
                                            runat="server" Text="<%$ Resources:MainGrid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton ID="ibtnRebindGrid" CommandName="RebindGrid" runat="server" ImageUrl="~/Design/images/Grid/Refresh.gif" />
                                        <asp:LinkButton ID="lbtnRebindGrid" Font-Size="14px" runat="server" Text="<%$ Resources:MainGrid , Refresh %>"
                                            CommandName="RebindGrid" />
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton">
                                <HeaderStyle Width="30px" />
                                <ItemStyle Width="30px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn DataField="PaymentVoucherDtlID" HeaderText="ID" SortExpression="PaymentVoucherDtlID"
                                UniqueName="PaymentVoucherDtlID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PaymentVoucherID" SortExpression="PaymentVoucherID"
                                UniqueName="PaymentVoucherID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Year" meta:ResourceKey="gbcYear" SortExpression="Year"
                                UniqueName="Year">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PayOrdID" meta:ResourceKey="gbcPayOrdID" SortExpression="PayOrdID"
                                UniqueName="PayOrdID">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LPOYear" meta:ResourceKey="gbcLPOYear" SortExpression="LPOYear"
                                UniqueName="LPOYear">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LPOID" meta:ResourceKey="gbcLPOID" SortExpression="LPOID"
                                UniqueName="LPOID">
                                <HeaderStyle Width="70px" />
                                <ItemStyle Width="70px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn DataField="AccountNo" DataSourceID="odsAccount" meta:ResourceKey="gbcAccountNo"
                                ListTextField="AccountNo" ListValueField="AccountNo" UniqueName="AccountNo" EnableEmptyListItem="True"
                                Visible="false">
                            </telerik:GridDropDownColumn>
                            <telerik:GridDropDownColumn DataField="AccountNo" DataSourceID="odsAccount" meta:ResourceKey="gbcAccount"
                                ListTextField="<%$ Resources:SystemResource, Account %>" ListValueField="AccountNo"
                                UniqueName="AccountName" EnableEmptyListItem="True">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn DataField="ProgramNo" meta:ResourceKey="gbcProgramNo" SortExpression="ProgramNo"
                                UniqueName="ProgramNo">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ProjectNo" meta:ResourceKey="gbcProjectNo" SortExpression="ProjectNo"
                                UniqueName="ProjectNo">
                                <HeaderStyle Width="100px" />
                                <ItemStyle Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Amount" meta:ResourceKey="gbcAmount" SortExpression="Amount"
                                UniqueName="Amount" Visible="true" DataFormatString="{0:###,###.##}">
                                <HeaderStyle Width="75px" />
                                <ItemStyle Width="75px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Remarks" meta:ResourceKey="gbcRemarks" SortExpression="Remarks"
                                UniqueName="Remarks" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>"
                                ConfirmTitle="Confirm" ButtonType="ImageButton" CommandName="Delete">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Width="50px" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings ColumnNumber="2" EditFormType="Template" CaptionDataField="ID"
                            CaptionFormatString="Edit properties of {0}" InsertCaption="New Line">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                                Width="100%" />
                            <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <EditColumn ButtonType="ImageButton" InsertText="Insert User" UpdateText="Update record"
                                UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                            </EditColumn>
                            <FormTableButtonRowStyle CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                            <FormTemplate>
                                <table id="Table2" cellspacing="2" cellpadding="1" border="0" rules="none">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblNewLine" Font-Bold="true" Font-Italic="true" runat="server" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "New Line", "Update Line") %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblYear" runat="server" meta:ResourceKey="lblYear"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="rtbYear" runat="server" MaxLength="4" MaxValue="2020"
                                                ValidationGroup="valPaymentVoucherDtl" IncrementSettings-InterceptArrowKeys="true"
                                                IncrementSettings-InterceptMouseWheel="true" Text='<%# Bind("Year") %>'>
                                                <NumberFormat DecimalDigits="0" GroupSizes="4" />
                                            </telerik:RadNumericTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblPayOrdID" runat="server" meta:ResourceKey="lblPayOrdID"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbPayOrdID" runat="server" Text='<%# Bind("PayOrdID") %>'
                                                ValidationGroup="valPaymentVoucherDtl">
                                            </telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblLPOYear" runat="server" meta:ResourceKey="lblLPOYear"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="rntLPOYear" runat="server" MaxLength="4" MaxValue="2020"
                                                ValidationGroup="valPaymentVoucherDtl" IncrementSettings-InterceptArrowKeys="true"
                                                IncrementSettings-InterceptMouseWheel="true" Text='<%# Bind("LPOYear") %>'>
                                                <NumberFormat DecimalDigits="0" GroupSizes="4" />
                                            </telerik:RadNumericTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblLPOID" runat="server" meta:ResourceKey="lblLPOID"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbLPOID" runat="server" Text='<%# Bind("LPOID") %>' ValidationGroup="valPaymentVoucherDtl">
                                            </telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblManrcbAccount" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                                            <asp:Label ID="lblrcbAccount" runat="server" meta:ResourceKey="lblrcbAccount"></asp:Label>
                                        </td>
                                        <td colspan="5">
                                            <uc1:DoubleFilteredDropDownList ID="WUCAcc" IsRequired="false" runat="server" DataSourceId="odsAccount"
                                                DataTextField="<%$ Resources:SystemResource, Account %>" DataValueField="AccountNo"
                                                SelectedValue='<%#  Bind( "AccountNo") %>' DefaultChoosedItem="ChooseOne" ValidationGroup="valPaymentVoucherDtl" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblProgramNo" runat="server" Text="<%$ Resources:SystemResource, lblProgram %>"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbProgramNo" runat="server" Text='<%# Bind("ProgramNo") %>'
                                                ValidationGroup="valPaymentVoucherDtl">
                                            </telerik:RadTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblProjectNo" runat="server" Text="<%$ Resources:SystemResource, lblProject %>"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbProjectNo" runat="server" Text='<%# Bind("ProjectNo") %>'
                                                ValidationGroup="valPaymentVoucherDtl">
                                            </telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblAmount" runat="server" meta:ResourceKey="lblAmount"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="rntbAmount" runat="server" ValidationGroup="valPaymentVoucherDtl"
                                                IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                                                Text='<%# Bind("Amount") %>'>
                                                <NumberFormat DecimalDigits="2" GroupSizes="4" />
                                            </telerik:RadNumericTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblRemarks" runat="server" meta:ResourceKey="lblRemarks"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbRemarks" SkinID="Remarks" runat="server" Text='<%# Bind("Remarks") %>'
                                                ValidationGroup="valPaymentVoucherDtl">
                                            </telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                            <div style="margin-top: 10px">
                                                <telerik:RadButton ID="btnInsert" meta:ResourceKey="btnInsert" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "True", "False") %>'
                                                    runat="server" CommandName="PerformInsert" Icon-PrimaryIconCssClass="rbOk" CausesValidation="true"
                                                    ValidationGroup="valPaymentVoucherDtl">
                                                </telerik:RadButton>
                                                <telerik:RadButton ID="btnUpdate" meta:ResourceKey="btnUpdate" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "False", "True") %>'
                                                    runat="server" CommandName="Update" CausesValidation="true" ValidationGroup="valPaymentVoucherDtl"
                                                    Icon-PrimaryIconCssClass="rbOk">
                                                </telerik:RadButton>
                                                &nbsp;
                                                <telerik:RadButton ID="btnCancel" meta:ResourceKey="btnCancel" runat="server" CausesValidation="False"
                                                    CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">
                                                </telerik:RadButton>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                        </EditFormSettings>
                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                            Font-Underline="False" HorizontalAlign="Center" Wrap="True" />
                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="False">
                        <Scrolling AllowScroll="false" ScrollHeight="400px" />
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                    <FilterMenu EnableTheming="True">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </FilterMenu>
                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                </telerik:RadGrid>
                <br />
                <br />
                <center>
                    <asp:Label ID="lblDeductionTitle" runat="server" meta:ResourceKey="DeductionTitle"
                        Font-Size="Large" Font-Bold="true"></asp:Label></center>
                <br />
                <br />
                <telerik:RadGrid ID="rgDeduction" runat="server" GridLines="None" DataSourceID="sdsDeduction"
                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" Width="100%" AllowAutomaticUpdates="True"
                    Skin="MetroTouch" AllowPaging="True" AutoGenerateColumns="False" MasterTableView-Dir="<%$ Resources:SystemResource, HTMLDirectionality %>"
                    GroupPanel-Text="<%$ Resources:MainGrid ,GroupPanelText %>" CellSpacing="0">
                    <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataSourceID="sdsDeduction"
                        DataKeyNames="DeductionID" NoMasterRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>">
                        <CommandItemTemplate>
                            <asp:ImageButton ID="ibtnInitInsert" CausesValidation="false" CommandName="InitInsert"
                                runat="server" ImageUrl="~/Design/images/Grid/AddRecord.gif" />
                            <asp:LinkButton ID="lbtnInitInsert" CausesValidation="false" runat="server" Font-Size="14px"
                                Text="<%$ Resources:MainGrid , AddNew %>" Visible="true" CommandName="InitInsert" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnEditSelected" CausesValidation="false" CommandName="EditSelected"
                                runat="server" ImageUrl="~/Design/images/Grid/Edit.gif" />
                            <asp:LinkButton ID="lbtnEditSelected" CausesValidation="false" runat="server" Font-Size="Medium"
                                Text="<%$ Resources:MainGrid , EditSelected %>" Visible="true" CommandName="EditSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnDeleteSelected" CausesValidation="false" CommandName="DeleteSelected"
                                OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                                ImageUrl="~/Design/images/Grid/Delete.gif" />
                            <asp:LinkButton ID="lbtnDeleteSelected" Font-Size="Medium" CausesValidation="false"
                                OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                                Text="<%$ Resources:MainGrid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnRebindGrid" CausesValidation="false" CommandName="RebindGrid"
                                runat="server" ImageUrl="~/Design/images/Grid/Refresh.gif" />
                            <asp:LinkButton ID="lbtnRebindGrid" Font-Size="Medium" CausesValidation="false" runat="server"
                                Text="<%$ Resources:MainGrid , Refresh %>" CommandName="RebindGrid" />
                            <asp:Literal ID="ltrArabicSpace" meta:ResourceKey="ArabicSpace" runat="server">
                            </asp:Literal>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn DataField="DeductionID" HeaderText="ID" ReadOnly="True"
                                SortExpression="DeductionID" UniqueName="DeductionID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PaymentVoucherID" SortExpression="PaymentVoucherID"
                                UniqueName="PaymentVoucherID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Year" meta:ResourceKey="gbcYear" SortExpression="Year"
                                UniqueName="Year">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="150px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AccountNo" Visible="false" SortExpression="AccountNo"
                                UniqueName="AccountNo">
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn DataField="AccountNo" DataSourceID="odsAccount" meta:ResourceKey="gbcAccount"
                                ListTextField="<%$ Resources:SystemResource, Account %>" ListValueField="AccountNo"
                                UniqueName="AccountNo" EnableEmptyListItem="True">
                                <HeaderStyle Width="120px" />
                                <ItemStyle Width="120px" />
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn DataField="ProgramNo" meta:ResourceKey="gbcProgramNo" SortExpression="ProgramNo"
                                UniqueName="ProgramNo">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ProjectNo" meta:ResourceKey="gbcProjectNo" SortExpression="ProjectNo"
                                UniqueName="ProjectNo">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Amount" meta:ResourceKey="gbcAmount" SortExpression="Amount"
                                UniqueName="Amount" DataFormatString="{0:###,###.##}">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Remarks" meta:ResourceKey="gbcRemarks" SortExpression="Remarks"
                                UniqueName="Remarks">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>"
                                ConfirmTitle="Confirm" ButtonType="ImageButton" CommandName="Delete">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings ColumnNumber="2" EditFormType="Template" CaptionDataField="UserName"
                            CaptionFormatString="Edit properties of {0}" InsertCaption="New User">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                                Width="100%" />
                            <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <EditColumn ButtonType="ImageButton" InsertText="Insert User" UpdateText="Update record"
                                UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                            </EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                            <FormTemplate>
                                <table id="Table2" cellspacing="2" cellpadding="1" border="0" rules="none">
                                    <tr style="margin-bottom: 40px">
                                        <td>
                                            <asp:Label ID="lblAddDeduction" Font-Bold="true" Font-Italic="true" runat="server"
                                                Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "New Deduction", "Update Deduction") %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblManrtbYear" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                                            <asp:Label ID="lblYear" runat="server" meta:ResourceKey="lblYear"></asp:Label>
                                            &nbsp;&nbsp;
                                        </td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="rtbYear" runat="server" MaxLength="4" MaxValue="2020"
                                                ValidationGroup="valDeduction" IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                                                Text='<%# Bind("Year") %>'>
                                                <NumberFormat DecimalDigits="0" GroupSizes="4" />
                                            </telerik:RadNumericTextBox>
                                            <asp:RequiredFieldValidator ID="rfvrtbYear" runat="server" ControlToValidate="rtbYear"
                                                ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valDeduction"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblProgramNo" runat="server" Text="<%$ Resources:SystemResource, lblProgram %>"></asp:Label>
                                            &nbsp;&nbsp;
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbProgramNo" Width="250px" runat="server" Text='<%# Bind("ProgramNo") %>'>
                                            </telerik:RadTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblProjectNo" runat="server" Text="<%$ Resources:SystemResource, lblProject %>"></asp:Label>
                                            &nbsp;&nbsp;
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbProjectNo" Width="250px" runat="server" Text='<%# Bind("ProjectNo") %>'>
                                            </telerik:RadTextBox>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblManAccountNo" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                                            <asp:Label ID="lblAccountNo" runat="server" Text="<%$ Resources:SystemResource, lblAccount %>"></asp:Label>
                                            &nbsp;&nbsp;
                                        </td>
                                        <td>
                                            <uc1:DoubleFilteredDropDownList ID="WUCAcc" IsRequired="true" runat="server" DataSourceId="odsAccount"
                                                DataTextField="<%$ Resources:SystemResource, Account %>" DataValueField="AccountNo"
                                                SelectedValue='<%# Bind("AccountNo") %>' DefaultChoosedItem="ChooseOne" ValidationGroup="valDeduction" />
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblAmount" runat="server" meta:ResourceKey="lblAmount"></asp:Label>
                                            &nbsp;&nbsp;
                                        </td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="rntbAmount" runat="server" ValidationGroup="valDeduction"
                                                IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                                                Text='<%# Bind("Amount") %>'>
                                                <NumberFormat DecimalDigits="2" GroupSizes="4" />
                                            </telerik:RadNumericTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblRemarks" runat="server" meta:ResourceKey="lblRemarks"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="rtbRemarks" SkinID="Remarks" runat="server" Text='<%# Bind("Remarks") %>'>
                                            </telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                            <div style="margin-top: 10px">
                                                <telerik:RadButton ID="btnInsert" meta:ResourceKey="btnInsert" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "True", "False") %>'
                                                    runat="server" CommandName="PerformInsert" Icon-PrimaryIconCssClass="rbOk" CausesValidation="true"
                                                    ValidationGroup="valDeduction">
                                                </telerik:RadButton>
                                                <telerik:RadButton ID="btnUpdate" meta:ResourceKey="btnUpdate" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "False", "True") %>'
                                                    runat="server" CommandName="Update" CausesValidation="true" ValidationGroup="valDeduction"
                                                    Icon-PrimaryIconCssClass="rbOk">
                                                </telerik:RadButton>
                                                &nbsp;
                                                <telerik:RadButton ID="btnCancel" meta:ResourceKey="btnCancel" runat="server" CausesValidation="False"
                                                    CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">
                                                </telerik:RadButton>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                        </EditFormSettings>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                            Font-Underline="False" HorizontalAlign="Center" Wrap="True" />
                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="False">
                        <Scrolling AllowScroll="false" ScrollHeight="400px" />
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                    <FilterMenu EnableTheming="True">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </FilterMenu>
                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                </telerik:RadGrid>
                <!------------------------------------------------------------------------------>
                <br />
                <br />
                <center>
                    <asp:Label ID="lbllCheque" runat="server" meta:ResourceKey="ChequeTitle" Font-Size="Large"
                        Font-Bold="true"></asp:Label></center>
                <br />
                <br />
                <!------------------------------------------------------------------------------>
                <table>
                    <tr>
                        <td colspan="4">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblManWUCBank" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                                                <asp:Label ID="lblBank" runat="server" meta:ResourceKey="lblBank"></asp:Label>
                                            </td>
                                            <td>
                                                <uc2:OneFilteredDropDownList ID="WUCBank" runat="server" DataSourceId="odsBank" DataValueField="BankID"
                                                    DefaultChoosedItem="ChooseOne" meta:ResourceKey="BankName" AutoPostBack="True"
                                                    IsRequired="True" ValidationGroup="MainForm" CausesValidation="false"  />
                                            </td>
                                            <td>
                                                <asp:Label ID="lblMandBankAccountNo" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                                                <asp:Label ID="lblBankAccountNo" runat="server" meta:ResourceKey="lblBankAccountNo"></asp:Label>
                                            </td>
                                            <td>
                                                <uc2:OneFilteredDropDownList ID="WUCBankAccountNo" IsRequired="true" runat="server"
                                                    DataSourceId="odsBankAccounts" DataValueField="ID" DefaultChoosedItem="ChooseOne"
                                                    DataTextField="AccountNo" ValidationGroup="MainForm" />
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblManChequeNo" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                            <asp:Label ID="lblChequeNo" runat="server" meta:ResourceKey="lblChequeNo"></asp:Label>
                        </td>
                        <td>
                            <telerik:RadTextBox ID="rtbChequeNo" Width="250px" runat="server" Text='<%# Bind("ChequeNo") %>'
                                ValidationGroup="valPaymentVoucherHdr">
                            </telerik:RadTextBox>
                            <asp:RequiredFieldValidator ID="rfvrtbChequeNo" runat="server" ControlToValidate="rtbChequeNo"
                                ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valPaymentVoucherHdr"></asp:RequiredFieldValidator>
                        </td>
                        <td>
                            <asp:Label ID="lblManChequeDate" runat="server" SkinID="Mandetory" Text="<%$ Resources:Controls, RequiredValidationText %>"></asp:Label>
                            <asp:Label ID="lblChequeDate" runat="server" meta:ResourceKey="lblChequeDate"></asp:Label>
                        </td>
                        <td>
                            <telerik:RadDatePicker runat="server" ID="rdpChequeDate" Culture="English (United States)"
                                ShowPopupOnFocus="true" DbSelectedDate='<%# Bind("ChequeDate") %>' Width="250px"
                                ValidationGroup="valPaymentVoucherHdr">
                                <DateInput ID="DateInput2" DateFormat="dd/MM/yyyy" runat="server">
                                </DateInput></telerik:RadDatePicker>
                            <asp:RequiredFieldValidator ID="rfvrdpChequeDate" runat="server" ControlToValidate="rdpChequeDate"
                                ErrorMessage="<%$ Resources:Controls, ErrorMessage %>" ValidationGroup="valPaymentVoucherHdr"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblChequeAmount" runat="server" meta:ResourceKey="lblAmount"></asp:Label>
                        </td>
                        <td>
                            <telerik:RadNumericTextBox ID="rntbChequeAmount" runat="server" ValidationGroup="valPaymentVoucherHdr"
                                IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                                Text='<%# Bind("ChequeAmount") %>' Width="250px">
                                <NumberFormat DecimalDigits="2" GroupSizes="4" />
                            </telerik:RadNumericTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblBeneficiaryName" runat="server" meta:ResourceKey="lblBeneficiaryName"></asp:Label>
                        </td>
                        <td>
                            <telerik:RadTextBox ID="rtbBeneficiaryName" runat="server" Text='<%# Bind("BeneficiaryName") %>'
                                ValidationGroup="valPaymentVoucherHdr">
                            </telerik:RadTextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblBeneficiaryAccountNo" runat="server" meta:ResourceKey="lblBeneficiaryAccountNo"></asp:Label>
                        </td>
                        <td>
                            <telerik:RadTextBox ID="rtbBeneficiaryAccountNo" runat="server" Text='<%# Bind("BeneficiaryAccountNo") %>'
                                ValidationGroup="valPaymentVoucherHdr">
                            </telerik:RadTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblBeneficiaryBankName" runat="server" meta:ResourceKey="lblBeneficiaryBankName"></asp:Label>
                        </td>
                        <td>
                            <telerik:RadTextBox ID="rtbBeneficiaryBankName" runat="server" Text='<%# Bind("BeneficiaryBankName") %>'
                                ValidationGroup="valPaymentVoucherHdr">
                            </telerik:RadTextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="text-align: left">
                <br />
                <asp:Label ID="lblFileUpload" runat="server" meta:ResourceKey="lblFileUpload"></asp:Label>
                &nbsp;&nbsp;
                <telerik:RadAsyncUpload runat="server" ID="AsyncUploadVoucher" meta:ResourceKey="RadUpload"
                    AllowedFileExtensions="jpg,jpeg,png,gif,bmp,txt,pdf,doc,docx,xls,xlsx">
                </telerik:RadAsyncUpload>
                <asp:Label ID="lblUploadError" runat="server" Visible="false" meta:ResourceKey="lblUploadError"
                    SkinID="Mandetory"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <telerik:RadGrid runat="server" ID="rgAttachments" Width="800px" DataSourceID="odsAttachments"
                    ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false" AllowAutomaticDeletes="True">
                    <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                        DataKeyNames="FileID" PageSize="7" HierarchyLoadMode="ServerOnDemand" Width="800px">
                        <Columns>
                            <telerik:GridBoundColumn DataField="FileID" HeaderText="FileID" ReadOnly="True" SortExpression="FileID"
                                UniqueName="FileID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Voucher_IDN" SortExpression="Voucher_IDN" UniqueName="Voucher_IDN"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridHyperLinkColumn Text="Open" UniqueName="OpenAttachment" DataNavigateUrlFields="Voucher_IDN,FileID"
                                DataNavigateUrlFormatString="~/UserControls/DisplayForm.aspx?Voucher_IDC=PV&Voucher_IDN={0}&FileID={1}">
                            </telerik:GridHyperLinkColumn>
                            <telerik:GridBoundColumn DataField="Name" meta:ResourceKey="gbcName" SortExpression="Name"
                                UniqueName="Name">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ContentType" meta:ResourceKey="gbcContentType"
                                SortExpression="ContentType" UniqueName="ContentType">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ConfirmText="<%$ Resources:MainGrid , ConfirmDelete %>"
                                ConfirmTitle="Confirm" ButtonType="ImageButton" CommandName="Delete">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridButtonColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <asp:ObjectDataSource ID="odsAttachments" runat="server" SelectMethod="QueryDatabase"
                    TypeName="DBtblFilesSP" DeleteMethod="QueryDatabase">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                        <asp:Parameter DefaultValue="RtvFile" Name="Operation" Type="String" />
                        <asp:Parameter Name="FileID" Type="String" />
                        <asp:Parameter Name="Voucher_IDC" DefaultValue="PV" Type="String" />
                        <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="Voucher_IDN" PropertyName="Value"
                            Type="String" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="ContentType" Type="String" />
                        <asp:Parameter Name="Data" Type="String" />
                    </SelectParameters>
                    <DeleteParameters>
                        <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
                        <asp:Parameter DefaultValue="DeleteFile" Name="Operation" Type="String" />
                        <asp:Parameter Name="FileID" Type="String" />
                        <asp:Parameter Name="Voucher_IDC" Type="String" />
                        <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="Voucher_IDN" PropertyName="Value"
                            Type="String" />
                        <asp:Parameter Name="Name" Type="String" />
                        <asp:Parameter Name="ContentType" Type="String" />
                        <asp:Parameter Name="Data" Type="String" />
                    </DeleteParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hdnChequeID" runat="server" />
    <asp:HiddenField ID="hdnPaymentVoucherID" runat="server" />
    <asp:ObjectDataSource ID="odsCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <br />
    <br />
    <telerik:RadButton ID="rbtnSave" runat="server" Text="<%$ Resources:SystemResource , rbtnSave %>"
        ValidationGroup="MainForm">
    </telerik:RadButton>
    &nbsp;
    <telerik:RadButton ID="rbtnDelete" runat="server" Text="<%$ Resources:SystemResource , rbtnDelete %>"
        CausesValidation="false">
    </telerik:RadButton>
    &nbsp;
    <telerik:RadButton ID="rbtnCancel" runat="server" Text="<%$ Resources:SystemResource , rbtnCancel %>"
        CausesValidation="false">
    </telerik:RadButton>
    <sds:SessionDataSource ID="sdsPaymentVoucherDtl" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"
        SelectCommand="SELECT [PaymentVoucherDtlID], [PaymentVoucherID], [Year], [PayOrdID],[LPOYear], [LPOID],[AccountNo], [ProgramNo], [ProjectNo], [Amount], [Remarks] FROM [PaymentVoucherDtl] WHERE  PaymentVoucherID = @PaymentVoucherID"
        DeleteCommand="DELETE FROM [PaymentVoucherDtl] WHERE [PaymentVoucherDtlID] = ?"
        InsertCommand="INSERT INTO [PaymentVoucherDtl]([PaymentVoucherID],[Year] ,[PayOrdID],[LPOYear], [LPOID]  ,[AccountNo],[ProgramNo] ,[ProjectNo] ,[Amount], [Remarks]) VALUES ( @PaymentVoucherID, ?,?,?, ?, ?, ?, ?, ?, ?)"
        UpdateCommand="UPDATE [PaymentVoucherDtl] SET [PaymentVoucherID] = @PaymentVoucherID ,[Year] = @Year  ,[PayOrdID] = @PayOrdID,[LPOYear] = @LPOYear, [LPOID] = @LPOID ,[AccountNo] = @AccountNo,[ProgramNo] = @ProgramNo ,[ProjectNo] = @ProjectNo , [Amount] = @Amount, [Remarks] = @Remarks WHERE [PaymentVoucherID] = ? ,[Year] = ?  ,[PayOrdID] = ? ,[AccountNo] = ?,[ProgramNo] = ? ,[ProjectNo] = ?   ,[Amount] = ?  ,[Remarks] = ?"
        PrimaryKeyFields="PaymentVoucherDtlID" OldValuesParameterFormatString="original_{0}"
        ConflictDetection="CompareAllValues" ClearSessionOnInitialLoad="True" SessionKey="System.Web.UI.Page_sdsPaymentVoucher">
        <SelectParameters>
            <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="PaymentVoucherID" PropertyName="Value"
                Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="PaymentVoucherID" PropertyName="Value"
                Type="String" />
            <asp:Parameter Name="Year" />
            <asp:Parameter Name="PayOrdID" />
            <asp:Parameter Name="ProgramNo" />
            <asp:Parameter Name="AccountNo" />
            <asp:Parameter Name="Amount" />
            <asp:Parameter Name="Remarks" />
        </UpdateParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="PaymentVoucherID" PropertyName="Value"
                Type="String" />
        </InsertParameters>
    </sds:SessionDataSource>
    <sds:SessionDataSource ID="sdsDeduction" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"
        SelectCommand="SELECT [DeductionID],[PaymentVoucherID],[Year],[AccountNo],[ProgramNo],[ProjectNo],[Amount],[Remarks] FROM [Deduction] WHERE  PaymentVoucherID = @PaymentVoucherID"
        DeleteCommand="Delete from Deduction WHERE DeductionID = ?" InsertCommand="INSERT INTO [Deduction]([PaymentVoucherID],[Year],[AccountNo],[ProgramNo],[ProjectNo],[Amount],[Remarks]) VALUES ( @PaymentVoucherID, ?, ?, ?, ?, ?, ?)"
        UpdateCommand="UPDATE [Deduction] SET [PaymentVoucherID] = @PaymentVoucherID ,[Year] = @Year  , AccountNo = @AccountNo,ProgramNo = @ProgramNo,ProjectNo = @ProjectNo, Amount = @Amount, Remarks = @Remarks WHERE [PaymentVoucherID] = ? ,[Year] = ?  ,[AccountNo] = ?,[ProgramNo] = ? ,[ProjectNo] = ?   ,[Amount] = ?  ,[Remarks] = ?"
        PrimaryKeyFields="DeductionID" OldValuesParameterFormatString="original_{0}"
        ConflictDetection="CompareAllValues" ClearSessionOnInitialLoad="True" SessionKey="System.Web.UI.Page_sdsDeduction">
        <SelectParameters>
            <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="PaymentVoucherID" PropertyName="Value"
                Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="PaymentVoucherID" PropertyName="Value"
                Type="String" />
            <asp:Parameter Name="Year" />
            <asp:Parameter Name="ProgramNo" />
            <asp:Parameter Name="AccountNo" />
            <asp:Parameter Name="Amount" />
            <asp:Parameter Name="Remarks" />
        </UpdateParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="hdnPaymentVoucherID" Name="PaymentVoucherID" PropertyName="Value"
                Type="String" />
        </InsertParameters>
    </sds:SessionDataSource>
    <asp:ObjectDataSource ID="odsSupplier" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBSupplierSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvSupplier" Name="Operation" Type="String" />
            <asp:Parameter Name="SupplierID" Type="String" />
            <asp:Parameter Name="SupplierName" Type="String" />
            <asp:Parameter Name="Mobile" Type="String" />
            <asp:Parameter Name="Tel" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="WebAddress" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="BankID" Type="String" />
            <asp:Parameter Name="BankAccountsID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsAccount" runat="server" SelectMethod="QueryDatabase"
        TypeName="AccountsSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvAllChildAccounts" Name="Operation" Type="String" />
            <asp:Parameter Name="AccountNo" Type="String" />
            <asp:Parameter Name="AccountNameAr" Type="String" />
            <asp:Parameter Name="AccountNameEn" Type="String" />
            <asp:Parameter Name="ParentID" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
            <asp:Parameter Name="AccountType" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsBankAccounts" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBBankAccountsSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvBankAccountsByBankID" Name="Operation" Type="String" />
            <asp:Parameter Name="ID" Type="String" DefaultValue="" />
            <asp:ControlParameter ControlID="WUCBank" DefaultValue="-1" Name="BankID" PropertyName="SelectedValue"
                Type="String" />
            <asp:Parameter Name="AccountNo" Type="String" />
            <asp:Parameter Name="AccountType" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsMainCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvMainCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsBank" runat="server" SelectMethod="QueryDatabase" TypeName="DBBankSP"
        DeleteMethod="QueryDatabase" InsertMethod="QueryDatabase" UpdateMethod="QueryDatabase">
        <DeleteParameters>
            <asp:Parameter Name="QueryType" Type="Object" />
            <asp:Parameter Name="Operation" Type="String" />
            <asp:Parameter Name="BankID" Type="String" />
            <asp:Parameter Name="BankName" Type="String" />
            <asp:Parameter Name="BankBranch" Type="String" />
            <asp:Parameter Name="Tel1" Type="String" />
            <asp:Parameter Name="Tel2" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="WebAddress" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="QueryType" Type="Object" />
            <asp:Parameter Name="Operation" Type="String" />
            <asp:Parameter Name="BankID" Type="String" />
            <asp:Parameter Name="BankName" Type="String" />
            <asp:Parameter Name="BankBranch" Type="String" />
            <asp:Parameter Name="Tel1" Type="String" />
            <asp:Parameter Name="Tel2" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="WebAddress" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvBank" Name="Operation" Type="String" />
            <asp:Parameter Name="BankID" Type="String" />
            <asp:Parameter Name="BankName" Type="String" />
            <asp:Parameter Name="BankBranch" Type="String" />
            <asp:Parameter Name="Tel1" Type="String" />
            <asp:Parameter Name="Tel2" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="WebAddress" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="QueryType" Type="Object" />
            <asp:Parameter Name="Operation" Type="String" />
            <asp:Parameter Name="BankID" Type="String" />
            <asp:Parameter Name="BankName" Type="String" />
            <asp:Parameter Name="BankBranch" Type="String" />
            <asp:Parameter Name="Tel1" Type="String" />
            <asp:Parameter Name="Tel2" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="WebAddress" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
</asp:Content>
